import { Icon } from '@iconify/vue'
import { h, type VNode } from 'vue'

export type SearchEngine = {
  param: string
  name: string
  url: string
  mobileurl?: string
  extra?: () => VNode
  newWindow?: boolean
}
const searchEngines: SearchEngine[] = [
  {
    param: 'baidu',
    name: '百度',
    url: 'https://www.baidu.com/s?wd=',
    extra: () => h(Icon, { icon: 'arcticons:autonavi' }),
    newWindow: true,
  },
  {
    param: 'bing',
    name: '必应',
    url: 'https://www.bing.com/search?q=',
  },
  {
    param: 'yandex',
    name: 'yandex',
    url: 'https://yandex.com/search/?text=',
    extra: () => h(Icon, { icon: 'arcticons:autonavi' }),
    newWindow: true,
  },
  {
    param: 'google',
    name: '谷歌',
    url: 'https://www.google.com/search?q=',
    extra: () => h(Icon, { icon: 'arcticons:autonavi' }),
    newWindow: true,
  },
  {
    param: 'sougou',
    name: '搜狗',
    url: 'https://www.sogou.com/web?query=',
  },
  {
    param: '360',
    name: '360',
    url: 'https://www.so.com/s?q=',
  },
  {
    param: 'zhihu',
    name: '知乎',
    url: 'https://www.zhihu.com/search?q=',
    extra: () => h(Icon, { icon: 'arcticons:autonavi' }),
    newWindow: true,
  },
  {
    param: 'weibo',
    name: '微博',
    url: 'https://s.weibo.com/weibo?q=',
  },
  {
    param: 'douban',
    name: '豆瓣',
    url: 'https://www.douban.com/search?q=',
    mobileurl: 'https://m.douban.com/search/?query=',
    extra: () => h(Icon, { icon: 'arcticons:autonavi' }),
    newWindow: true,
  },
  {
    param: 'bilibili',
    name: '哔哩哔哩',
    url: 'https://search.bilibili.com/all?keyword=',
    extra: () => h(Icon, { icon: 'arcticons:autonavi' }),
    newWindow: true,
  },
  {
    param: 'ppx',
    name: '皮皮虾资源',
    url: 'https://ppxzy.net/?s=',
    // https://ppxzy.org/
  },
  {
    param: 'gaoqing',
    name: '中国高清网',
    url: 'https://gaoqing.la/?s=',
  },
  {
    param: 'GreenBoyVideo',
    name: '乐坏影视',
    url: 'http://liben.online/videos/#/s?wd=',
  },
]
export default searchEngines
